<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<input type="hidden" name="organizations/organization[0]/sequence_no" value="1" >
<input type="hidden" name="organizations/organization[0]@submit_org" value="1" >
<input type="hidden" name="organizations/organization[0]/org_code" value="<x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/>" >
<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo1" cellspacing="1" style="table-layout:fixed;">
	<col width="13%;"/>
	<col width="6%;"/>
	<col width="21%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr> 
		<td   colspan="7" class="t_bar2">项目基本情况</td>
	</tr>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>项目名称（中文）：</td>
		<td colspan="5" >
			<input name="proposal/zh_title" id="zh_title" label="项目名称（中文）" type="text"  class="input_text required " style="width: 82%;"   maxlength="30" value="<x:out select="$xmlData/data/proposal/zh_title" />"/>（限30个字）
		</td>
	</tr>
	<tr >
	<td  align="right" colspan="2"><span class="color_red">*</span>项目名称（英文）：</td>
	<td colspan="5" >
			<input name="proposal/en_title" id="en_title" label="项目名称（英文）" type="text"  class="input_text required " style="width: 82%;"   maxlength="200" value="<x:out select="$xmlData/data/proposal/en_title" />"/>（限200个字）
		</td>
	</tr>
	</table>
	<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo2" cellspacing="1" style="table-layout:fixed;">
	<col width="13%;"/>
	<col width="6%;"/>
	<col width="21%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr >
		<td align="right" colspan="2" ><span class="color_red">*</span>学科分类1：</td>
  		 <td   class="li_2">
          <c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />',
						       'name':'<x:out select="$xmlData/data/proposal/subject_name" />'}
		  </c:set>
			<cpt:tree key="sciences" className="hn_iuput_kuang required" 
			onlyChooseLeaf="true" readonly="true" 
			cacheable="false"  value="${subject}" id="subject" name="proposal/subject"  
			showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科分类1" />
			<input type="hidden" id="subject_code" name="proposal/subject_code" value="<x:out select="$xmlData/data/proposal/subject_code" />"  label="${param.title}-->学科分类1"/> 
			<input type="hidden" id="subject_name" name="proposal/subject_name" value="<x:out select="$xmlData/data/proposal/subject_name" />" />
			</td>
  	 	  <td align="right">代码：</td>
  	 	<td>
  	 	<input id="subject_value" label="${param.title}-->学科分类1-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject_value"
				value="<x:out select="$xmlData/data/proposal/subject_value" />" />
  	 	</td>
  	 	 <td align="right" >专业评审组名称：</td>
  	 	<td>
  	 	<input id="department_value" type="hidden" name="proposal/department_value"  
  	 	label="专业评审组名称"  value="<x:out select="$xmlData/data/proposal/department_value" />"/>
            <span id="department_name"  name="proposal/department_name"><x:out select="$xmlData/data/proposal/department_name" /></span>
                
		</td>
	</tr>
	
		<tr>
		<td align="right" colspan="2">学科分类2：</td>
  		 <td>
          <c:set var="subject4">{'id':'<x:out
						select="$xmlData/data/proposal/subject4_code" />','name':'<x:out
						select="$xmlData/data/proposal/subject4_name" />'}
		  </c:set>
			<cpt:tree key="sciences" className="hn_iuput_kuang" cacheable="false" readonly="true" value="${subject4}" id="subject4" name="proposal/subject4"  showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科分类2" />
			<input type="hidden" id="subject4_code" name="proposal/subject4_code" value="<x:out select="$xmlData/data/proposal/subject4_code" />"  /> 
			<input type="hidden" id="subject4_name" name="proposal/subject4_name" value="<x:out select="$xmlData/data/proposal/subject4_name" />" />
			</td>
  	 	  <td align="right" >代码：</td>
  	 	<td colspan="3">
  	 	<input id="subject4_value" label="${param.title}-->学科分类2-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject4_value"
				value="<x:out select="$xmlData/data/proposal/subject4_value" />" />
  	 	</td>
	</tr>
	<tr >
		<td align="right" colspan="2">学科分类3：</td>
  		 <td   class="li_2">
          <c:set var="subject5">{'id':'<x:out
						select="$xmlData/data/proposal/subject5_code" />','name':'<x:out
						select="$xmlData/data/proposal/subject5_name" />'}
		  </c:set>
			<cpt:tree key="sciences" className="hn_iuput_kuang"  cacheable="false" readonly="true" value="${subject5}" id="subject5" name="proposal/subject5"  showPattern="all" shieldPattern="-1 " onClick="initTreeValuejsdtr"   label="学科分类名称-->学科名称3" />
			<input type="hidden" id="subject5_code" name="proposal/subject5_code" value="<x:out select="$xmlData/data/proposal/subject5_code" />"/> 
			<input type="hidden" id="subject5_name" name="proposal/subject5_name" value="<x:out select="$xmlData/data/proposal/subject5_name" />" />
			</td>
  	 	  <td align="right">代码：</td>
  	 	<td colspan="3">
  	 	<input id="subject5_value" label="${param.title}-->学科分类3-->代码"
				type="text" class="gray" disabled="disabled" style="width:110px;"
				maxlength="50" name="proposal/subject5_value"
				value="<x:out select="$xmlData/data/proposal/subject5_value" />" />
  	 	</td>
	</tr>
	</table>
	<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo3" cellspacing="1" style="table-layout:fixed;">
	<col width="13%;"/>
	<col width="6%;"/>
	<col width="21%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>科技成果名称：</td>
		<td  colspan="2">
			<input type="text" name="proposal/tech_type_name" class="input_text required maxlength:100"  label="科技成果名称" maxlength="100"value="<x:out select="$xmlData/data/proposal/tech_type_name" />">
		</td>
		<td  align="right"><span class="color_red">*</span>省级成果登记号：</td>
		<td  colspan="2">
			<input name="proposal/reg_no" id="reg_no" label="省级成果登记号" type="text"  class="input_text required maxlength:100"    maxlength="100"  value="<x:out select="$xmlData/data/proposal/reg_no" />"/>
		</td>
		
	</tr>
	<tr>
		<td  align="right"  colspan="2" style="border-bottom:0px;"><span class="color_red">*</span>推荐单位（或专家）：</td>
		<td  style="border-bottom:0px;" colspan="2">
			<c:set var="recommend_type_value"><x:out select="$xmlData/data/proposal/recommend_type_value" /></c:set>
			<cpt:select id="recommend_type"  key="recommend_type"  value="${recommend_type_value}" onChange="initControlValue(this.id);setRecommend();"  style="width:150px;"></cpt:select>
			<input type="hidden" id="recommend_type_value" name="proposal/recommend_type_value" class="required" value="${recommend_type_value}" label="推荐单位（或专家）">
			<input type="hidden" name="proposal/recommend_type_name" value="<x:out select="$xmlData/data/proposal/recommend_type_name" />">
		</td>

  	 	
      <%-- <td  align="right"><span class="color_red">*</span>任务来源：</td>
		<td colspan="2">
			<c:set var="mission_source">{'id':'<x:out select="$xmlData/data/proposal/mission_source_value" />',
			'name':'<x:out select="$xmlData/data/proposal/mission_source_name" />'}
		  	</c:set>
			<cpt:tree key="countryplan" cacheable="false" readonly="true" value="${mission_source}" id="mission_source" name="proposal/mission_source"  showPattern="all" shieldPattern="0" onClick="initTreeValueExt" label="任务来源" />
			<input type="hidden" name="proposal/mission_source_value" class="required" label="任务来源" value="<x:out select="$xmlData/data/proposal/mission_source_value" />" >
			<input type="hidden" name="proposal/mission_source_name" value="<x:out select="$xmlData/data/proposal/mission_source_name" />">
		</td> --%>
		<td colspan="3"></td>
	</tr>
	</table>
	<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo4" cellspacing="1" style="table-layout:fixed;">
	<col width="13%;"/>
	<col width="6%;"/>
	<col width="21%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr >
		<td align="right" colspan="2"><span class="color_red">*</span>任务来源：</td>
		<td colspan="5">国家级科技计划：<br/>
		<cpt:checkbox key="mission_source8" name="mission_source5" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source5_value" id="missionsource5" value="<x:out select="$xmlData/data/proposal/mission_source5_value" />" class="" label="国家级科技计划"/>
         <input type="hidden" name="proposal/mission_source5_name" value="<x:out select="$xmlData/data/proposal/mission_source5_name" />" />
		省、部级计划：<br/>
		<cpt:checkbox key="mission_source9" name="mission_source6" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source6_value" id="missionsource6" value="<x:out select="$xmlData/data/proposal/mission_source6_value" />" class="" label="省、部级计划"/>
         <input type="hidden" name="proposal/mission_source6_name" value="<x:out select="$xmlData/data/proposal/mission_source6_name" />" />
		其他：<br/>
		<cpt:checkbox key="mission_source10" name="mission_source7" repeatColumn="4" tagType="checkbox" style="border: 0px; padding: 0px; margin: 0px;"  width="-1" lastOther="true" ></cpt:checkbox>
         <input type="hidden" name="proposal/mission_source7_value" id="missionsource7" value="<x:out select="$xmlData/data/proposal/mission_source7_value" />" class="" label="其他"/>
         <input type="hidden" name="proposal/mission_source7_name" value="<x:out select="$xmlData/data/proposal/mission_source7_name" />" /> 
		</td>
	</tr>
	</table>
	<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo5" cellspacing="1" style="table-layout:fixed;">
	<col width="13%;"/>
	<col width="6%;"/>
	<col width="21%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<col width="15%;"/>
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>计划名称：</td>
		<td colspan="2">
			  <input type="text" id="plan_name" name="proposal/plan_name" 
			  value="<x:out select="$xmlData/data/proposal/plan_name" />" class="required maxlength:100"  maxlength="100" label="计划名称"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>计划编号：</td>
		<td colspan="2">
			  <input type="text" id="plan_no" name="proposal/plan_no" 
			  value="<x:out select="$xmlData/data/proposal/plan_no" />" class="required maxlength:100" maxlength="100" label="计划编号"/> 
		</td>
		</tr>
		<tr>
		<td  align="right" colspan="2"><span class="color_red">*</span>主题词：</td>
		
		<td colspan="5">
			  <input type="text" id="subject_headings" name="proposal/subject_headings" 
			  value="<x:out select="$xmlData/data/proposal/subject_headings" />" style="width:82%" class="required maxlength:100" label="主题词"/> 
			  <p>按《国家汉语主题词表》填写3个至7个与推荐项目技术内容密切相关的主题词，每个词语间应加“；”号。</p>
		</td>
	</tr>
	
	<tr >
		<td  align="right" colspan="2"><span class="color_red">*</span>项目开始时间：</td>
	   <td colspan="2">
		 	<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date"  name="proposal/start_date" value="${start_date}" className=" required date   dateCompare:end_date "  label="项目开始时间" ></cpt:date> 
	   </td>
	   <td  align="right"><span class="color_red">*</span>项目结束时间：</td>
	   <td colspan="2">
	    	<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date " label="项目结束时间" ></cpt:date> 
	   </td>
	</tr>
	<tr id="tr_recomment">
		<td align="right" colspan="2"><span class="color_red">*</span>推荐单位：</td>
		<td colspan="5">
		<c:set var="recomend_org">
		{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
		'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'
		}					
		</c:set> <cpt:tree id="recomend_org" key="recommended"
				cacheable="false" className="hn_iuput_kuang required selectWidth3"
				readonly="true" value="${recomend_org}" label="推荐单位"
				showPattern="all" shieldPattern="0"
				onClick="initTreeValue2_qhh">
			</cpt:tree> <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"
			value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" />
			<input type="hidden" id="recomend_org_name" name="proposal/recomend_org_name"
			value="<x:out select="$xmlData/data/proposal/recomend_org_name" />" />
		</td>
	</tr>
</table>


<script type="text/javascript">





$(function(){
	/* setRendingType('show_title_value'); */
	setRecommend();
	/* setSummary();  */
});

function setEmptyValueForTree(id){
	$("#"+id).val("");
	$("#"+id+"_code").val("");
	$("#"+id+"_value").val("");
	$("#"+id+"_name").val("");
	$("#" + id).parents("td").find("[name$='" + id + "_code'],[id$='" + id + "_code']").val("");
	$("#" + id).parents("td").find("[name$='" + id + "_value'],[id$='" + id + "_value']").val("");
	$("#" + id).parents("td").find("[name$='" + id + "_name'],[id$='" + id + "_name']").val("");
	if(id=="subject"){
		$("#department_name").text("");
		$("#department_value").val("");
	}
	
}

function setRecommend(){
	var recommend_type = $("#recommend_type_value").val();
	if(recommend_type == '02'){   //专家推荐
		$("#tab10").show();
		$("#tr_recomment").hide();
		$("#recomend_org").val("");
		$("#recomend_org_value").val("");
		$("#recomend_org_name").val("");
		$("#recomend_org").removeClass("required");
		$("#recPro_upload .file").val("");
		/* $("#recPro_upload").find("input[id='file_code']").attr("class","required"); */
	}else if(recommend_type == '01'){     //单位推荐
	
		$("#tab10").hide();
		$("#tr_recomment").show();
		$("#recomend_org").addClass("required");
		$("#recPro_upload").find("input[id='file_code']").val("");
		$("#recPro_upload").find("span[id='file_name']").text("");
		$("#recPro_upload").find("span[id='file_date']").text("");
		$("#recPro_upload").find("tr[id='uploadsuccess']").hide();
		
	}else{
		$("#tab10").hide();
		$("#tr_recomment").hide();
		$("#recomend_org").val("");
		$("#recomend_org_value").val("");
		$("#recomend_org_name").val("");
		$("#recomend_org").removeClass("required");
		$("#recPro_upload .file").val("");
		$("#recPro_upload").find("input[id='file_code']").val("");
		$("#recPro_upload").find("span[id='file_name']").text("");
		$("#recPro_upload").find("span[id='file_date']").text("");
		$("#recPro_upload").find("tr[id='uploadsuccess']").hide();
		
	}
}









	function setParent(id,showFlag){
		var parentTr = $("#" + id).parent();
		  if(parentTr.is('tr')){
			  if(showFlag)
			  	parentTr.show();
			  else
			  	parentTr.hide();
		  }else{
			  if(showFlag)
			  	  parentTr.parent().show();
			  else
				  parentTr.parent().hide();
		  }
	}


$(document).ready(function() {
	setAppOrgInfoShowHidden();
});

function setAppOrgInfoShowHidden(){
	var type = $("#tech_type_value").val();
	if(type=='05'){
		//hidden
			$("#div_app_org_info").hide();
		$("#div_app_org_info_other").show();
		$("#projectQhh").hide();
		
		$("#title11").text("主要论文专著他引情况及科学意义和价值");
		
		
	}else{
		//show
		$("#div_app_org_info").show();
		$("#div_app_org_info_other").hide();
		$("#projectQhh").show();
		
		$("#title11").text("应用情况及效益");
		
	}
}


function initTreeValue2_qhh(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		
	
		setInformation(treeNode.id);
	}





	function setInformation(re_org_code){
		
		if(re_org_code !=null){
		 $.ajax({
	         type: "post",
	         url: "${ctx}/proposal/get-reorg-contactinfo",
	         data: {re_org_code:re_org_code},
	         dataType: "json",
	         success: function(data){
	        	            /*   alert(JSON.stringify(data) );
	        	            alert(data.PNAME); */
	        	       if(data.PNAME == null || data.TEL == null || data.EMAIL == null || data.FAX == null){
	        	    	   irisValaddMsg("请联系相应的推荐单位完善单位信息");
	        	       }else{
	        	    	   $("#reco_lixiren").val(data.PNAME);
	                   $("#reco_mobile").val(data.TEL);
	                   $("#reco_email").val(data.EMAIL);
	                   $("#reco_fax").val(data.FAX);
	                   }
	                  }
	     });
		}
	}

//显示全名称路径
function buildName(treeNode, params){
	var str = treeNode.name;
	var obj = treeNode.parentNode;
	while(obj!=null){
		//str =obj.name+"-"+str;
		obj = obj.parentNode;
	}
	return str;
}

function initTreeValueExt(treeId, treeNode) {

	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);

}


function initTreeValueExt2(treeId, treeNode) {

	if (( treeNode && treeNode.level == 0)) {
		scmWarn($("#" + treeId).attr("label")+"不能选择第一级，请选择它的子级！");
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);

}




function initTreeValue2(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.level == 0)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
	}
	
	
	
	
	
	function setRendingType(obj){
		var value =$("#"+obj).val();
		if(value == '1'){
				$("#tr_show_title").show();
				$("#show_title_scope").parents("td").find("[class='datepick-trigger']").attr('style','padding-left: 3px; cursor: pointer; vertical-align: middle;');
				$("#show_title_scope").removeAttr('disabled');
				$("#show_title_level").attr("class","required");
				$("#show_title_scope").attr("className","required");
				$("#show_title_scope").parents("td").find("[class='datepick-trigger']").removeAttr('disabled');
		}else{
			   $("#tr_show_title").hide();
				$("#show_title_level").val("");
				$("#show_title_scope").val("");
		}
	}
function initTreeValuejsdtr(treeId, treeNode) {
			if (( treeNode && treeNode.level == 0)) {
				scmWarn($("#" + treeId).attr("label")
						+ messageTip.researchAreaInvalidDisciplineCode);
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val("");
				return false;
			}else if(treeNode.level == 1 && treeNode.isParent){
				scmWarn("请选择下面的子节点");
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val("");
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val("");
				return false;
			}else{
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val(treeNode.id);
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val(treeNode.name);
				$("#" + treeId).parents("td").find("[name$='" + treeId + "_value']").val(treeNode.id);
			}
	  	
			
		var oldval = $("#" + treeId).parents("td").find("[name$='" + treeId + "_code']").val();
		var oldname = $("#" + treeId).parents("td").find("[name$='" + treeId + "_name']").val();
		oldval = $.trim(oldval);
		oldname = $.trim(oldname);
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		/* $("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name']").val(str); */
		if(treeId=="subject"){
			if(treeNode.level > 1){
				$("#department_name").text(treeNode.parentNode.parentNode.name);
				if(treeNode==""){
					$("#department_name").text("");
				}
				$("#department_value").val(treeNode.parentNode.parentNode.id);
			}else{
				$("#department_name").text(str);
				$("#department_value").val(treeNode.id);
			}
			
		}
		
		$("#" + treeId + "_value").val(treeNode.id);

	}
function missionsource()
{
	var missionsource5=$("#missionsource5").val();
	var missionsource6=$("#missionsource6").val();
	var missionsource7=$("#missionsource7").val();
	if(missionsource5=="" && missionsource6=="" && missionsource7==""){
		return true;
	}
	return false;
}
</script>

